#ifndef OPTRAAPPLICATION_H
#define OPTRAAPPLICATION_H

#include <defs/export.h>
#include <defs/global.h>
#include <Core/entityobject.h>
#include "pch.h"

namespace Optra {

    class TasksController;
    O_PRIVATE_DECLARE(OptraApplication);
    class OPTRA_EXPORT OptraApplication : public Opl::Core::EntityObject
    {
        Q_OBJECT
    public:
        OptraApplication(Opl::Core::EntityObject *parent = 0);
        ~OptraApplication();
        bool Initialize();
        void Finalize();

        TasksController* tasks()const;
        static OptraApplication* Instance();

        QVariant globalConfig(const QString& section, const QString& key, const QVariant& def = QVariant());
    private:
        O_PRIVATE_DECLARE_MEMBER(OptraApplication)
    };

    inline QVariant OptraConfigValue(const QString& section, const QString& key, const QVariant& def = QVariant()){
        return OptraApplication::Instance()->globalConfig(section, key, def);
    }
}
#endif // OPTRAAPPLICATION_H


